<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>PayChannel</title>
<link href="styles/general.css" rel="stylesheet" type="text/css" /><link href="styles/main.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/transport.js"></script>
    <script type="text/javascript" src="js/common.js"></script>
    <script src="js/utils.js" type="text/javascript"></script>
     <script type="text/javascript" src="js/jquery/jquery-1.7.2.min.js"></script>
     <!--<script type="text/javascript" src="js/jquerytablesorter/jquery.tablesorter.min.js"></script>-->
	<script type="text/javascript">
		function apppointofbillingshow(type,id,appnumber)
		{
			var cpid = document.getElementById("cpid").value;
			var categoryparentid = document.getElementById("categoryparentid").value;
			var appName = document.getElementById("appName").value;
			if(type=="delete")
			{
				if(!window.confirm('警告！！确定要删除吗？'))
					return false;
				else{
					window.location.href="apppointofbilling_save.do?type="+type+"&model.id="+id+"&appinfo.appnumber="+appnumber+"&cpid="+cpid+"&categoryparentid="+categoryparentid+"&appName="+appName;
				}
			}else
			{
				window.location.href="apppointofbilling_show.do?type="+type+"&model.id="+id+"&appinfo.appnumber="+appnumber+"&cpid="+cpid+"&categoryparentid="+categoryparentid+"&appName="+appName;
			}
		}
		function goback()
		{
			var cpid = document.getElementById("cpid").value;
			var categoryparentid = document.getElementById("categoryparentid").value;
			var appName = document.getElementById("appName").value;
			window.location.href="app_list.do?cpid="+cpid+"&categoryparentid="+categoryparentid+"&appName="+appName;
		}
	</script>
	<style type="text/css">
	h1 .action-span2{
		float: right;
	}
	h1 .action-span2 a {
	    -moz-border-bottom-colors: none;
	    -moz-border-left-colors: none;
	    -moz-border-right-colors: none;
	    -moz-border-top-colors: none;
	    background: 3px center #ddeef2;
	    border-color: #278296;
	    border-image: none;
	    border-style: solid;
	    border-width: 1px 2px 2px 1px;
	    color: #666;
	    display: block;
	    font-size: 12px;
	    font-weight: 400;
	    padding: 2px 5px 2px 5px;
	    text-decoration: none;
	}
	</style>
</head>

<body>
<h1>
        <span class="action-span"><a href="javascript:void(0);" onclick="apppointofbillingshow('insert','-1','<s:property value="appinfo.appnumber"/>')">添加计费点</a></span>
        <span class="action-span2"><a href="apppointentry_list.do?model.appnumber=<s:property value="appinfo.appnumber"/>">计费点入口列表</a></span> 
        <span class="action-span1"><a href="mainframe.jsp"> 首页</a></span>
        <span id="search_id" class="action-span1">- 计费点管理（ 游戏名称：<s:property value="appinfo.appname"/>） </span>
    </h1>
     <input name="cpid" type="hidden" id="cpid"  value="<s:property value="cpid"/>"/>
    <input name="categoryparentid" type="hidden" id="categoryparentid"  value="<s:property value="categoryparentid"/>"/>
    <input name="appName" type="hidden" id="appName"  value="<s:property value="appName"/>"/>
   <!-- start ad menu list -->
    <div class="list-div" id="listDiv">
     <table id="myTable" width="100%" cellspacing="1" cellpadding="2" class="sortable">
         <thead>
             <tr>
                <th height="25px;">序号</th>
                <th>触发计费说明</th>
		        <th>计费点代码</th>
		        <th>计费点名称</th>
		        <th>资费(分)</th>
		        <th width="30px;">类型</th>
		        <th>道具功能</th>
		        <!-- <th>描述</th> -->
		        <th>操作</th>
             </tr>
              </thead>
             <s:if test="map.size()>0">
             <tbody>
             <s:iterator value="map">
             <s:if test="value.size>0">
			 <s:iterator value="value" status="i"> 
				 <tr>
				 	<s:if test="#i.index==0">
				 	<s:if test="key==0">
				 	<td rowspan="<s:property value="value.size()"/>" style="background-color: rgb(255, 255, 255);text-align: center;">无</td>
				 	<td rowspan="<s:property value="value.size()"/>" style="background-color: rgb(255, 255, 255);">无</td>
				 	</s:if>
				 	<s:else>
				 	<s:iterator value="entrylist">
				 	<s:if test="key==id">
				 	<td rowspan="<s:property value="value.size()"/>" style="background-color: rgb(255, 255, 255);text-align: center;"><s:property value="entrycode"/></td>
				 	<td rowspan="<s:property value="value.size()"/>" style="background-color: rgb(255, 255, 255);"><s:property value="triggerremark"/></td>
				 	</s:if>
				 	</s:iterator>
				 	</s:else>
				 	</s:if>	                
				    <td style="background-color: rgb(255, 255, 255);text-align: center;"><s:property value="code"/></td> 
				    <td style="background-color: rgb(255, 255, 255);text-align: center;"><s:property value="pointofbillingname"/></td>
				    <td style="background-color: rgb(255, 255, 255);text-align: center;"><s:property value="fee"/></td>
				    <td style="background-color: rgb(255, 255, 255);text-align: center;"><s:if test='"0".equals(type)'>单次</s:if><s:if test='"1".equals(type)'>重复</s:if></td>
				    <td style="background-color: rgb(255, 255, 255);"><s:property value="propremark"/></td>
				    <!-- <td style="background-color: rgb(255, 255, 255);"><s:property value="remark"/></td> -->
				    <td nowrap="nowrap" align="center" style="background-color: rgb(255, 255, 255);">
				     <s:if test="isUpdate.equals('true')">
					     <a href="javascript:void(0);" onclick="apppointofbillingshow('update','<s:property value="id"/>','<s:property value="appinfo.appnumber"/>')">
					     	<img height="16" width="16" border="0" src="img/icon_edit.gif" alt="编辑"></a>&nbsp;
						<a href="javascript:void(0);" onclick="apppointofbillingshow('delete','<s:property value="id"/>','<s:property value="appinfo.appnumber"/>')"onclick="return window.confirm('警告！！确定要删除吗？')">
							<img height="16" width="16" border="0" src="img/icon_trash.gif" alt="删除">
						</a>	
					</s:if>
					<s:else>
						<a href="javascript:void(0);" onclick="apppointofbillingshow('update','<s:property value="id"/>','<s:property value="appinfo.appnumber"/>')">
							<img height="16" width="16" border="0" src="img/icon_view.gif" alt="查看">
						</a>   
					</s:else>
					</td>
				</tr>
			</s:iterator>
			</s:if>
			<s:else>
			<tr>
				<s:iterator value="entrylist">
				 	<s:if test="key==id">
				 	<td style="background-color: rgb(255, 255, 255);text-align: center;"><s:property value="entrycode"/></td>
				 	<td style="background-color: rgb(255, 255, 255);"><s:property value="triggerremark"/></td>
				 	<td colspan="6" style="background-color: rgb(255, 255, 255);text-align: center;">无</td>
				 	</s:if>
				</s:iterator>
			</tr>
			</s:else>
			</s:iterator>
			</tbody>
			</s:if>
			<s:else><tr><td colspan="9" style="background-color: rgb(255, 255, 255);text-align: center;">无</td></tr></s:else>
			<tr>
				<td colspan="9" align="center"><input type="button" value=" 返回 " class="button" onclick="goback()"/></td>
			</tr>
  </table>
  </div>
 <!--Bottom开始-->
    <script language="JavaScript">

if (document.getElementById("listDiv"))
{
  document.getElementById("listDiv").onmouseover = function(e)
  {
    obj = Utils.srcElement(e);

    if (obj)
    {
      if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode;
      else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode;
      else return;

      for (i = 0; i < row.cells.length; i++)
      {
        if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#eeeded';
      }
    }

  }

  document.getElementById("listDiv").onmouseout = function(e)
  {
    obj = Utils.srcElement(e);

    if (obj)
    {
      if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode;
      else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode;
      else return;

      for (i = 0; i < row.cells.length; i++)
      {
          if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#FFF';
      }
    }
  }

}
	/* $(document).ready(function() {
	   $("#myTable").tablesorter();
	}); */
    </script>
    
<div id="footer">
<br />
<s:property value="bottom"/></div>
    <!--Bottom结束-->
</body>
</html>